package com.joey.cloud.provider.psn;


import com.alibaba.fastjson.JSONObject;
import com.joey.cloud.communal.constant.ServiceConstant;
import com.joey.cloud.communal.dto.UserAuthDto;
import com.joey.cloud.communal.utils.ResponseUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = ServiceConstant.KEY_PSN,fallback = PsnFeignFallback.class)
public interface PsnFeignService {
    /**
     * 获取用户名称
     * @param userIds
     * @return
     */
    @RequestMapping(value = "/business/person/queryNameById",method = RequestMethod.GET)
    ResponseUtil queryPersonNameById(@RequestParam("userIds") String userIds);

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    @RequestMapping(value = "/business/person/{id}",method = RequestMethod.GET)
    ResponseUtil getPerson(@PathVariable("id") Long id);

    /**
     * 获取用户权限信息
     * @param psnId
     * @return
     */
    @RequestMapping(value = "/business/person/queryPsnAuthInfo/{psnId}",method = RequestMethod.GET)
    ResponseUtil<UserAuthDto> queryPsnAuthInfo(@PathVariable("psnId") Long psnId);

    /**
     * 插入用户信息
     * @param obj
     * @return
     */
    @RequestMapping(value = "/business/person",method = RequestMethod.POST)
    ResponseUtil insertPsn(@RequestBody Object obj);
}
